<?php

/**
 * Description of guestAction
\* www.teuker.nl - mail@teuker.nl
 * 
 * @author francisc
 * 
 * mod: HV - !isset became isset
 */

class guestAction extends sfAction {

    public function execute($request) {
        $this->form = new ReservationGuestForm();

        if (isset($_COOKIE['guest_user_options'])) {
            $remeber_data = json_decode ($_COOKIE['guest_user_options'], true);
            $this->form->setDefaults(array('salutation' => $remeber_data['gender'],
                                           'name_first' => $remeber_data['name_first'],
                                           'name_last' => $remeber_data['name_last'],
                                           'name_company' => $remeber_data['name_company'],
                                           'address' => $remeber_data['address'],
                                           'phone' => $remeber_data['phone'],
                                           'mobile' => $remeber_data['mobile'],
                                           'email' => $remeber_data['email'],
                                           'time_hour' => '18',
            							   'time_minute' => '30',
                                           'comments_diet' => $remeber_data['comments_diet']));
        }
        else {
            $this->form->setDefault('time_hour', '18');
            $this->form->setDefault('time_minute', '30');
        }
    }
}
